#include <iostream>
#include <unordered_map>
using namespace std;
int main()
{
	int a[] = { 5,8,7,6,89,5,3,5,5,4,11};
	unordered_map<int, int> mp;
	for (auto& e : a)
	{
		mp.insert(make_pair(e, e));
	}
	cout << mp.bucket_count()<<endl;
	for (auto& e:a)
	{
		cout<<mp.bucket(e)<<" ";
	}
	return 0;
}